home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
414_01
/
the.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-23
|
26KB
|
787 lines
/*
* THE - The Hessling Editor. A text editor similar to VM/CMS xedit.
* Copyright (C) 1991-1993 Mark Hessling
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to:
*
* The Free Software Foundation, Inc.
* 675 Mass Ave,
* Cambridge, MA 02139 USA.
*
*
* If you make modifications to this software that you feel increases
* it usefulness for the rest of the community, please email the
* changes, enhancements, bug fixes as well as any and all ideas to me.
* This software is going to be maintained and enhanced as deemed
* necessary by the community.
*
* Mark Hessling email: M.Hessling@gu.edu.au
* 36 David Road Phone: +61 7 849 7731
* Holland Park Fax: +61 7 875 5314
* QLD 4121
* Australia
*/
/*
$Header: C:\THE\RCS\the.h 1.4 1993/09/01 16:27:20 MH Interim MH $
*/
#include "defines.h"
#if defined(USE_NCURSES)
# include <ncurses.h>
# define SYSVR32
#else
# if defined(USE_EXTCURSES)
# include <cur00.h>
# define SYSVR32
# define A_COLOR
# define COLOR_BLACK 0
# define COLOR_BLUE 1
# define COLOR_GREEN 2
# define COLOR_CYAN 3
# define COLOR_RED 4
# define COLOR_MAGENTA 5
# define COLOR_YELLOW 6
# define COLOR_WHITE 7
typedef char bool;
# define chtype NLSCHAR
# define COLOR_PAIRS 64
extern chtype color_pair[COLOR_PAIRS];
# define COLOR_PAIR(n) color_pair[n]
# define wattrset(win,attr) xstandout(win,attr)
# define attrset(attr) xstandout(stdscr,attr)
# define nocbreak() nocrmode()
# define cbreak() crmode()
# define wnoutrefresh(win) wrefresh(win)
# else
# include <curses.h>
# endif
#endif
#ifdef __OS2__
# undef MSDOS /* in case you are using MSC 6.0 for OS/2 */
# undef SYSV /* set in curses.h */
# undef BSD /* set in curses.h */
# define SYSVR32curses
# define SYSVR31curses
# define SYSVR3curses
# include <stdlib.h>
# include <memory.h>
# include <string.h>
# include <process.h>
# include <errno.h>
# include <ctype.h>
# include <sys\types.h>
# include <sys\stat.h>
# define W_OK 02
# define F_OK 00
# define R_OK 04
# define ESLASH '\\'
# define ESTR_SLASH (char *)"\\"
# ifdef EMX
# define OSLASH '\\'
# define OSTR_SLASH (char *)"\\"
# define ISLASH '/'
# define ISTR_SLASH (char *)"/"
# else
# define OSLASH '/'
# define OSTR_SLASH (char *)"/"
# define ISLASH '\\'
# define ISTR_SLASH (char *)"\\"
# endif
# define CURRENT_DIR (char *)"."
# define FMODE (0)
# ifdef MSC
/* the following 2 defines are to make MSC recognise the new names */
/* of the following OS/2 calls */
# define DosSetDefaultDisk DosSelectDisk
# define DosQueryCurrentDisk DosQCurDisk
# endif
#endif
#if defined(__MSDOS__) || defined(MSDOS)
# define SYSVR32curses
# define SYSVR31curses
# define SYSVR3curses
# undef SYSV /* set in curses.h */
# undef BSD /* set in curses.h */
# include <stdlib.h>
# include <memory.h>
# include <string.h>
# ifdef GO32
# include <dir.h>
# else
# include <process.h>
# include <direct.h>
# endif
# include <errno.h>
# include <io.h>
# include <ctype.h>
# include <sys\types.h>
# include <sys\stat.h>
# define W_OK 02
# define F_OK 00
# define R_OK 04
# define ESLASH '\\'
# define ESTR_SLASH (char *)"\\"
# ifdef GO32
# define OSLASH '\\'
# define OSTR_SLASH (char *)"\\"
# define ISLASH '/'
# define ISTR_SLASH (char *)"/"
# else
# define OSLASH '/'
# define OSTR_SLASH (char *)"/"
# define ISLASH '\\'
# define ISTR_SLASH (char *)"\\"
# endif
# define CURRENT_DIR (char *)"."
# define FMODE (0)
/*#define FMODE (S_IREAD | S_IWRITE)*/
#endif
#ifdef SYSVR4
# undef BSD
# ifndef SYSV
# define SYSV
# endif
# include <ctype.h>
# include <unistd.h>
# define SYSVR4curses
# define SYSVR32curses
# define SYSVR31curses
# define SYSVR3curses
#endif
#ifdef SYSVR32
# undef BSD
# ifndef SYSV
# define SYSV
# endif
# include <ctype.h>
# include <unistd.h>
# define SYSVR32curses
# define SYSVR31curses
# define SYSVR3curses
#endif
#ifdef SYSVR31
# undef BSD
# ifndef SYSV
# define SYSV
# endif
# define SYSVR31curses
# define SYSVR3curses
#endif
#ifdef SYSVR3
# undef BSD
# ifndef SYSV
# define SYSV
# endif
# define SYSVR3curses
#endif
#ifdef SYSV
# undef BSD
# define SYSVcurses
# if !defined(ATT)
# include <stdlib.h>
# include <sys/file.h>
# endif
# include <memory.h>
# include <string.h>
# include <sys/types.h>
# include <sys/stat.h>
# define FMODE (0)
# define UNIX 1
#endif
#ifdef BSD
# include <stdlib.h>
# include <memory.h>
# include <string.h>
# include <sys/file.h>
# include <sys/types.h>
# include <sys/stat.h>
# define FMODE (0)
# define chtype short
# define UNIX 1
# define BSDcurses 1
# define NO_KEYPAD 1
# define attrset(attr) wattrset(stdscr,attr)
# ifdef linux
# include <unistd.h>
# endif
#endif
#ifdef M_XENIX
# include <ctype.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <memory.h>
# include <string.h>
# include <sys/file.h>
# define F_OK 00
# define W_OK 02
# define R_OK 04
# define touchline(WIN,START,NUM) touchwin(WIN)
# define FMODE (0)
# define UNIX 1
#endif
#ifdef MINIX
# include <string.h>
# define short int
# define UNIX 1
#endif
#ifdef UNIX
# define ESLASH '/'
# define ESTR_SLASH (char *)"/"
# define OSLASH '\\'
# define OSTR_SLASH (char *)"\\"
# define ISLASH ESLASH
# define ISTR_SLASH ESTR_SLASH
# define CURRENT_DIR (char *)"."
#endif
#ifdef VMS
# include <string.h>
# include <file.h>
# include <types.h>
# include <stat.h>
# include <ctype.h>
# define W_OK 02
# define F_OK 00
# define R_OK 04
# define ISLASH ']'
# define ISTR_SLASH (char *)"]"
# define OSLASH ISLASH
# define OSTR_SLASH ISTR_SLASH
# define ESLASH ISLASH
# define ESTR_SLASH ISTR_SLASH
# define CURRENT_DIR (char *)"[]"
/*#define FMODE (S_IRWXU | S_IRGRP | S_IROTH)*/
# define FMODE (0)
# ifdef BSD
# define chtype short
# define BSDcurses 1
# endif
# define touchline(WIN,START,NUM) touchwin(WIN)
/* #define isdigit(c) (_ctype[(c) + 1] & 2)
# define islower(c) (_ctype[(c) + 1] & 8)
# define isupper(c) (_ctype[(c) + 1] & 4)*/
# define NO_KEYPAD 1
#endif
/*---------------------------------------------------------------------*/
/* End of OS-specific defines */
/*---------------------------------------------------------------------*/
#ifndef A_NORMAL
/* Various video attributes */
#ifdef BSD
#define A_STANDOUT _STANDOUT /* for compatability with old curses */
#define A_REVERSE _STANDOUT /* for compatability with old curses */
#define A_UNDERLINE 0
#define A_BLINK 0
#define A_DIM 0
#define A_BOLD _STANDOUT
/* The next two are subject to change so don't depend on them */
#define A_INVIS 0
#define A_PROTECT 0
#define A_NORMAL 0
#define A_CHARTEXT 0x007F
#define A_ATTRIBUTES ~A_CHARTEXT
#define A_ALTCHARSET 0
#else
#define A_STANDOUT 000000200000L
#define A_UNDERLINE 000000400000L
#define A_REVERSE 000001000000L
#define A_BLINK 000002000000L
#define A_DIM 000004000000L
#define A_BOLD 000010000000L
#define A_ALTCHARSET 00010